// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space 

package com.anda.driver.util;

import java.io.InputStream;

public class StreamUtil
{

	public StreamUtil()
	{
	}

	public static String getString(InputStream paramInputStream)
	  {
	    StringBuilder localStringBuilder = new StringBuilder();
	    byte[] arrayOfByte = new byte[102400];
	    try
	    {
	      while (true)
	      {
	        int i = paramInputStream.read(arrayOfByte, 0, arrayOfByte.length);
	        if (i == -1)
	        {
	          paramInputStream.close();
	          return localStringBuilder.toString();
	        }
	        localStringBuilder.append(new String(arrayOfByte, 0, i));
	      }
	    }
	    catch (Exception localException)
	    {
	      while (true)
	        localException.printStackTrace();
	    }
	  }

	  public static String getString(InputStream paramInputStream, String paramString)
	  {
	    StringBuilder localStringBuilder = new StringBuilder();
	    byte[] arrayOfByte = new byte[102400];
	    try
	    {
	      while (true)
	      {
	        int i = paramInputStream.read(arrayOfByte, 0, arrayOfByte.length);
	        if (i == -1)
	        {
	          paramInputStream.close();
	          return localStringBuilder.toString();
	        }
	        localStringBuilder.append(new String(arrayOfByte, 0, i, paramString));
	      }
	    }
	    catch (Exception localException)
	    {
	      while (true)
	        localException.printStackTrace();
	    }
	  }
}
